# CMakeList.txt: 顶层 CMake 项目文件，在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required (VERSION 3.25)

project (SchemaConvert)

set(CMAKE_CXX_STANDARD 17)

if (MSVC)
    add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
endif ()

include_directories(${CMAKE_SOURCE_DIR}/LibCIMModel)

include_directories(${CMAKE_SOURCE_DIR}/3rdlibs/xlnt/include)

#[[
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    message("Debug mode is enabled.")
    link_directories(${CMAKE_SOURCE_DIR}/3rdlibs/xlnt/lib/Debug)
else ()
    message("Release mode is enabled.")
    link_directories(${CMAKE_SOURCE_DIR}/3rdlibs/xlnt/lib/Release)
endif ()
]]

set(G_TmpLibPaths
            debug ${CMAKE_SOURCE_DIR}/3rdlibs/xlnt/lib/Debug
            optimized ${CMAKE_SOURCE_DIR}/3rdlibs/xlnt/lib/release)

# set(G_TmpLibPaths ${CMAKE_SOURCE_DIR}/3rdlibs/xlnt/lib)

message("SchemaConvert, CMakeLists.txt, G_TmpLibPaths : " ${G_TmpLibPaths})

link_directories(${G_TmpLibPaths})
link_directories(${CMAKE_SOURCE_DIR}/out/build/OpenCIM/LibCIMModel)

add_executable(SchemaConvert main.cpp)

set(G_TmpLibraries
            debug libCIMModel_d xlntd
            optimized libCIMModel_r xlnt)

target_link_libraries(SchemaConvert ${G_TmpLibraries})

#[[
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    message("Debug mode is enabled.")
    target_link_libraries(SchemaConvert LibCIMModel_d xlntd)
else ()
    message("Release mode is enabled.")
    target_link_libraries(SchemaConvert LibCIMModel_r xlnt)
endif ()
]]